package leetcode;

public class _1869 {
    /**
     * 哪种连续子字符串更长
     */
    class Solution {
        public boolean checkZeroOnes(String s) {
            int len1 =0, len0= 0;
            int max1 =0, max0 =0;
            for(int i=0;i<s.length();i++){
                if (s.charAt(i)=='0'){
                    len0++;
                    len1=0;
                }else{
                    len1++;
                    len0=0;
                }
                max0 = Math.max(max0,len0);
                max1 = Math.max(max1,len1);
            }
            return max1>max0;
        }
    }
}
